package JDBC;

import java.sql.*;
class Type4Test1{
public static void main(String str[]){
Connection con=null;
Statement st=null;
if(str.length!=3){
System.out.println("Provide the required value as CLA");
System.exit(0);
}
int id=Integer.parseInt(str[0]);
String name=str[1];
String email=str[2];
try{
con=DBUtil.getConnection();
//con=com.jlc.jdbc.util.DBUtil.getConnection();
String qry="";
qry="insert into studentinfo values("+id+",'"+name+"','"+email+"')";
System.out.println(qry);
st=con.createStatement();
int x=st.executeUpdate(qry);
System.out.println("Record Affected:\t"+x);
}catch(SQLException e){
System.out.println("Error in Database Operation");
e.printStackTrace();
}
finally{
DBUtil.close(null,st,con);
//com.jlc.jdbc.util.DBUtil.close(null,st,con);
}
}
}